﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using rk310.BLL;
using rk310.DAL;
using rk310.MODEL;

namespace rk310.UI.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class RoomController : ControllerBase
    {
        public RoomController(Roombll roombll)
        {
            Roombll = roombll;
        }

        public Roombll Roombll { get; }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="room"></param>
        /// <returns></returns>
        [HttpPost("AddRoom")]
        public int AddRoom(Room room)
        {
            try
            {
                return Roombll.AddRoom(room);
            }
            catch (Exception)
            {

                throw;
            }

        }

        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetRoom")]
        public dynamic GetRoom()
        {
            try
            {
                return Roombll.GetRoom();
            }
            catch (Exception)
            {

                throw;
            }

        }

    }
}
